import time
import logging
import requests
import json
import random
from ceshi_ip import sel
# 提取代理API接口，获取1个代理IP
api_url = "https://dps.kdlapi.com/api/getdps/?orderid=969446626073773&num=20&pt=1&format=json&sep=1"
# 获取API接口返回的代理IP
proxy_ip_s = requests.get(api_url).text
proxy_list = json.loads(proxy_ip_s)['data']['proxy_list']
print(len(proxy_list))
ip_port = random.choice(proxy_list)
sel(ip_port)

# while True:
#     time_now = time.strftime("%H:%M:%S", time.localtime())  # 刷新
#     if time_now == "15:30:10":  # 此处设置每天定时的时间
#
#         # 此处3行替换为需要执行的动作
#         print("hello")
#         subject = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + " 定时发送测试"
#         print(subject)
#
#         time.sleep(2)  # 因为以秒定时，所以暂停2秒，使之不会在1秒内执行多次
